package thread;

public class TestThread1 extends Thread {
    private ThreadLocal<Integer> threadLocal;
    private String name;

    public TestThread1(ThreadLocal<Integer> threadLocal, String name) {
        this.threadLocal = threadLocal;
        this.name = name;
    }

    public void run() {
        for (int i = 0; i < 3; i++) {
            threadLocal.set(i);
            System.out.println(name + "," + threadLocal.get());
        }
    }
}
